/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.mwas.proteana.geneontology.util;

import java.util.Objects;
import pl.mwas.proteana.geneontology.GOTerm;

/**
 *
 * @author mateusz.was
 */
public class Relation {
    private Relationship type;
    private final GOTerm relatedTerm;

    public Relation(Relationship type, GOTerm relatedTerm) {
        this.type = type;
        this.relatedTerm = relatedTerm;
    }

    public Relationship getType() {
        return type;
    }

    public GOTerm getRelatedTerm() {
        return relatedTerm;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + Objects.hashCode(this.type);
        hash = 89 * hash + Objects.hashCode(this.relatedTerm);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Relation other = (Relation) obj;
        if (this.type != other.type) {
            return false;
        }
        if (!Objects.equals(this.relatedTerm, other.relatedTerm)) {
            return false;
        }
        return true;
    }
    
    
}
